﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RestaurateurConsole
{
    public partial class OpenBillNo : Form
    {
        public OpenBillNo()
        {
            InitializeComponent();
            this.DialogResult = DialogResult.Cancel;
        }

        public OpenBillNo(string title, string label)
        {
            InitializeComponent();
            this.DialogResult = DialogResult.Cancel;
            this.Text = title;
            this.label1.Text = label;
        }

        public int SalesID { get; set; }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                this.SalesID = Int32.Parse(textBox1.Text);
                this.DialogResult = DialogResult.OK;
            }
            catch
            {
                MessageBox.Show("Please enter a number in the Accounts number box.");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }
    }
}
